package com.guoheng.safe.sys.controller;

import com.guoheng.safe.common.base.Result;
import com.guoheng.safe.sys.dto.UserLoginDTO;
import com.guoheng.safe.sys.service.UserService;
import io.swagger.annotations.Api;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * 类功能描述:LoginController
 *
 * @author Eternal
 * @date 2018/7/22 0:15
 */
@RestController
@Validated
@Api(value = "用户登录")
public class LoginController {

    @Resource
    UserService userService;

    @PostMapping(value = "user/login")
    public Result login(@RequestBody  @Valid UserLoginDTO userLoginDTO){
        return userService.login(userLoginDTO);
    }
}
